import request from '@/utils/request'

// 获取月卡列表
/**
 * @description: 获取月卡列表
 * @param {*} params { page,pageSize}
 * @return {*} promise
 */
export const getCardListAPI = (params) => {
  return request({
    url: '/parking/card/list',
    params
  })
}

/**
 * 新增月卡
 */
export function addCardAPI(data) {
  return request({
    url: '/parking/card',
    method: 'post',
    data
  })
}

/**
 * 获取月卡详情
 */
export function getCardDetailAPI(id) {
  return request({
    url: `/parking/card/detail/${id}`
  })
}

/**
 * 更新月卡
 */
export function updateCardAPI(data) {
  return request({
    url: '/parking/card/edit',
    method: 'put',
    data
  })
}

/**
 * 删除月卡
 */
export function deleteCardAPI(ids) {
  return request({
    url: `/parking/card/${ids}`,
    method: 'delete'
  })
}
